#ifndef __USER_CODE_RUN_EVENT_HPP__
#define __USER_CODE_RUN_EVENT_HPP__


#include "base_event.hpp"

namespace run_code_event_space {

struct user_code_run_event : base_event<user_code_run_event>  {
    template <class U>
    ProcessStatus execute_impl(run_code_context_t<U>& context, const string& inFile);
};

template <class U>
ProcessStatus user_code_run_event::execute_impl(run_code_context_t<U>& context, const string& inFile) {
    const RuncodeParams& params = context.params;
    const U& judge_type = context.judge_type;
    return general_execution_strategy::run_code<true, U>(
                judge_type.userCodeInfo.runStr, params.timeLimit, params.memoryLimit, 
                inFile, "",
                judge_type.userCodeInfo.lang,
                context.params.userCachePath);
}

}

#endif /* __USER_CODE_RUN_EVENT_HPP__ */
